var xhr = {
    post : function(send_to,param){
        var isLoad = arguments[2]?arguments[2]:false;
        $.ajax({
            url:send_to,
            data:param,
            type:'post',
            cache:false,
            dataType:'json',
            beforeSend:function(XMLHttpRequest){
                if (isLoad) {
                    $("#load").html("<img src='/jqueryStu/images/loading.gif'/>");
                }
            },
            success:function(ret) {
                if(ret.status==200){
                    alert(ret.msg);
                    window.location.reload();
                }else if(ret.status==308){
                    window.location.href=ret.url;
                }else{
                    alert(ret.msg);
                }
             },
             complete:function(XMLHttpRequest) {
                if(isLoad){$("#load").empty;}
             },
             error : function(XMLHttpRequest) {
                alert("异常！");
             }
        });
    },
    get : function(){
        return 'post';
    }
}